package com.hands.sample.handlers;

import com.amazon.ask.dispatcher.request.handler.HandlerInput;
import com.amazon.ask.dispatcher.request.handler.RequestHandler;
import com.amazon.ask.model.Response;
//import com.soundai.skill.helloworld.log.log;

import java.util.Optional;

import static com.amazon.ask.request.Predicates.intentName;

public class WhoRequestHandler  implements RequestHandler  {

    @Override
    public boolean canHandle(HandlerInput input) {
        return input.matches(intentName("zengliang"));
    }

    @Override
    public Optional<Response> handle(HandlerInput input) {

        //log.writeFile("C://001.log","执行WhoRequestHandler接口" + input);
        String speechText = "你好二零零九" + input;
        return input.getResponseBuilder()
                .withSpeech(speechText)
                .withSimpleCard("HelloWorld", speechText)
                .build();
    }

}
